\begin{problem}{Connect Four}{connect.in}{connect.out}{2 seconds}{}{}

     Connect Four is a two-player board game played on 
     a grid with 6 rows and 7 columns. The 
     game starts with an empty board, and players take alternate 
     turns dropping stones down non-full columns. At each 
     turn, a player drops a single stone down a single column. 
     The stone then occupies the bottom-most unoccupied square 
     on that column. 

\begin{verbatim}
  a b c d e f g
6 . . . O . . .
5 . . . X . . .
4 . . . O . . .
3 . . . X . . .
2 . . . O . X .
1 . . X X O O X
\end{verbatim}

Here a `\texttt{.}' denotes an unoccupied square; 
the first player's stones and the second player's 
are represented by `\texttt{X}' and `\texttt{O}' respectively. In the 
example above, it's the second player's turn to drop 
a stone in one of the six valid positions: 
a1, b1, c2, e2, f3, and g2. The game ends when a player wins 
by placing at least four of his/her stones consecutively in 
at least one line, either horizontally, vertically, or 
diagonally. In the following example, the first 
player has successfully placed four stones in a line (d5-e4-f3-g2) 
thus winning the game. 

\begin{verbatim}
  a b c d e f g
6 . . . O . . .
5 . . . X . O .
4 . . O O X X O
3 . . O X O X X
2 O . X O X X X
1 O . X X O O X
\end{verbatim}

The game may also end in a draw if 
the board is completely filled without anyone winning. After 
a game ends, the players are not allowed to drop more stones onto the board. 

Your task is to determine who is moving, and is the position valid or no.

\InputFile

Input file contains a board, representing the 6 
rows in a top-down manner. Each row of board will 
have exactly 7 characters representing the squares in a row 
from left to right: `\texttt{.}' denotes an empty square; 
`\texttt{X}' denotes a stone of the first player; 
and `\texttt{O}' (a capital English letter) denotes a stone of the second player. 

\OutputFile

Your program should return one of the six possible values:

\begin{itemize}
\item ``\texttt{first player moves}'' --- 
return this when it's the first player's turn to drop a stone. 
\item ``\texttt{second player moves}'' --- return this when it's 
the second player's turn to drop a stone. 
\item ``\texttt{first player wins}'' --- return this 
when the first player has won the game. 
\item ``\texttt{second player wins}'' --- return this when the 
second player has won the game. 
\item ``\texttt{draw game}'' --- return this when the board 
is full and neither player wins the game. 
\item ``\texttt{invalid}'' --- return this when it's impossible to 
produce the given board without violating the rules (e.g. 
dropping stones in bad positions, playing out of turn, or 
dropping stones when the game has ended.) 
\end{itemize}
  

\Example

\begin{example}
\exmp{
.......
.......
.......
.......
.......
.......
}{
first player moves
}%
\exmp{
.......
.......
.......
...X...
...O...
...X...
}{
second player moves
}%
\exmp{
.......
.......
X......
OX.....
XOXO...
OXOX...
}{
first player wins
}%
\exmp{
.......
.......
.X.....
.X.....
.X..XX.
XOOOOOO
}{
second player wins
}%
\end{example}
\begin{example}
\exmp{
OOXOXOX
XXXOXOO
OXXOOXO
XOOXXOO
XXXOOXX
XOOXXOO
}{
draw game
}%
\exmp{
...X...
.......
.......
.......
...X...
...O...
}{
invalid
}%
\exmp{
.......
.......
.......
.......
OOOO...
XXXX...
}{
invalid
}%
\exmp{
XXO.XOX
OOX.OXX
XXO.XXO
OOXXOOO
XXOOXOO
OOXOOXX
}{
invalid
}%
\end{example}

\end{problem}